package behavioral.mediator;

/**
 * @Description: 中介者测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class MediatorTest {
    public static void main(String[] args) {
        Colleague sender = new Colleague("小明");
        Colleague receiver = new Colleague("小红");
        AbstractMediator mediator = new ChatMediator(sender, receiver);

        sender.setMediator(mediator);
        receiver.setMediator(mediator);

        sender.sendMessage();
    }
}
